/**
 * 
 */
package com.google.code.sip.ucenter.web.admin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.google.code.sip.ucenter.imports.Importer;

/**
 * @author Liuye
 * 
 */
@Controller
public class ImportController {
	@Autowired
	private Importer settingImporter;
	@Autowired
	private Importer roleImporter;
	@Autowired
	private Importer userImporter;
	@Autowired
	private Importer creditTypeImporter;
	@Autowired
	private Importer creditRuleImporter;

	@RequestMapping("/admin/import.do")
	public ModelAndView install() throws Exception {
		settingImporter.execute();
		roleImporter.execute();
		userImporter.execute();
		creditTypeImporter.execute();
		creditRuleImporter.execute();
		return new ModelAndView("admin.index");
	}
}
